package com.ssm.controller;

import com.ssm.entity.Preview_Problem;
import com.ssm.service.Preview_ProblemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping(value = "preview_problem")
@Controller
@CrossOrigin
public class Preview_ProblemController {

    @Autowired
    public Preview_ProblemService preview_problemService;
    public void setPreview_problemService(Preview_ProblemService preview_problemService) {
        this.preview_problemService = preview_problemService;
    }

    @ResponseBody
    @RequestMapping(value = "getProblem_Answer")
    public Preview_Problem getProblem(@RequestParam("address") String address){
        Preview_Problem preview_problem = this.preview_problemService.getProblem(address);
        return preview_problem;
    }

}
